import graph.*;
import dijkstra.*;

public class TEST {
	public static void main(String[] args) {
		Graph g = new Graph();
		g.addNewVertex("a");
		g.addNewVertex("b");
		g.addNewVertex("c");
		g.addNewVertex("d");
		System.out.print(g.getIdByName("a")+" "+g.getIdByName("b")+" "+g.getIdByName("c")+" "+g.getIdByName("d"));
		g.addNewEdge(g.getIdByName("a"), g.getIdByName("b"), 1);
		g.addNewEdge(g.getIdByName("a"), g.getIdByName("c"), 1);
		g.addNewEdge(g.getIdByName("a"), g.getIdByName("d"), 3);
		g.addNewEdge(g.getIdByName("b"), g.getIdByName("c"), 1);
		g.addNewEdge(g.getIdByName("c"), g.getIdByName("d"), 2);
		Algorithm a = new Algorithm(g,g.getIdByName("c"));
		a.findWays();
		int l = a.getWays().getWaysCount();
		int id_;
		int dis_;
		System.out.println("");
		for(int i = 0; i < l; i++){
			id_ = a.getWays().getWayByPosition(i).getVertexId();
			dis_ = a.getWays().getWayByPosition(i).getDistanceFromStart();
			System.out.println(id_+": "+g.getNameById(id_)+" - "+dis_);
		}
	}
}
